import os, sys

outputfile = 'runtime/renderhog'

env = Environment()
env.Append(CCFLAGS = ['-g3'])
if ( 'win32' == sys.platform or 'cygwin' == sys.platform ):
	env.Append(LINKFLAGS = ['-Wl,-subsystem,windows'])
	env.Append(LIBS = ['opengl32', 'glu32', 'glew32', 'mingw32', 'assimp'])
	env.MergeFlags(['!c:/msys/GTK/2.0/bin/pkg-config gtkmm-2.4 --cflags --libs'])
	env.MergeFlags(['!c:/msys/GTK/2.0/bin/pkg-config gtkglextmm-1.2 --cflags --libs'])
	env.Append(CPPPATH=['c:/msys/1.0/include'])
	env.Append(LIBPATH=['c:/msys/1.0/lib'])
else:
	env.Append(LIBS = ['GLEW', 'assimp'])
	env.MergeFlags(['!pkg-config gtkmm-2.4 --cflags --libs'])
	env.MergeFlags(['!pkg-config gtkglextmm-1.2 --cflags --libs'])

list = Split("""SOILjoe/image_helper.c
		SOILjoe/stb_image_aug.c
		SOILjoe/image_DXT.c
		SOILjoe/SOIL.c
		main.cpp
		glwindow.cpp
		scenenode.cpp
		scenemanager.cpp
		renderer.cpp
		nodeeditor.cpp
		utils.cpp
		filemod.cpp
		joeserialize.cpp
		application.cpp""")

list.sort(lambda x, y: cmp(x.lower(),y.lower()))

env['ARCOMSTR'] = "\tARCH $TARGET"
env['CCCOMSTR'] = "\tCC $TARGET"
env['CXXCOMSTR'] = "\tCPP $TARGET"
env['LINKCOMSTR'] = "\tLINK $TARGET"
env['RANLIBCOMSTR'] = "\tRANLIB $TARGET"

outputprogram = env.Program(outputfile, list)

